import request from '@/api/request'
// 获取列表
function articleList(start, limit, data) {
  return request({
    url: `/lejuAdmin/productArticle/findArticles/${start}/${limit}`,
    method: 'post',
    data
  })
}



// 更新文章显示状态
function changeShowStatus(data) {
  return request({
    url: `/lejuAdmin/productArticle/changeShowStatus`,
    method: 'post',
    data
  })
}



// 新增文章
function addArticle(data) {
  return request({
    url: `/lejuAdmin/productArticle/addArticle`,
    method: 'post',
    data
  })
}


// 删除文章
function articleDelete(id) {
  return request({
    url: `/lejuAdmin/productArticle/del/${id}`,
    method: 'delete'
  })
}


// 上传图片素材
function uploadFileOss(id) {
  return request({
    url: `/lejuAdmin/material/uploadFileOss`,
    method: 'post'
  })
}


// 更新文章
function updateArticl(data) {
  return request({
    url: `/lejuAdmin/productArticle/updateArticle`,
    method: 'post',
    data
  })
}



// 文章详细
function productArticle(id) {
  return request({
    url: `/lejuAdmin/productArticle/productArticle/${id}`,
    method: 'get'
  })
}


// 删除素材
function delMaterial(id) {
  return request({
    url: `/lejuAdmin/material/delMaterial/${id}`,
    method: 'DELETE'
  })
}







export default {
  articleList,
  articleDelete,
  changeShowStatus,
  uploadFileOss,
  addArticle,
  updateArticl,
  productArticle,
  delMaterial
}
